package moltencore.game.collision;

import moltencore.game.bubble.AbstractBubble;
import spark.math.Vector2;
import moltencore.game.bubble.Bubble;

public interface ICollidable {
	/**
	 * Calculates the movement a bubble may travel until colliding with a collidable.
	 * @param bubble    A {@code blazingbubble.game.Bubble bubble} resting at a certain position.
	 * @param movement  Distance this bubble will travel.
	 * @return  The bubbles position at which it collides with the collidable, null if no collision occurs.
	 */
	public Vector2 collisionPoint(AbstractBubble bubble, Vector2 movement);
	/**
	 * Calculates if a bubble collides with the collidable.
	 * @param bubble    A {@code blazingbubble.game.Bubble bubble} resting at a certain position.
	 * @param movement  Distance this bubble will travel.
	 * @return  true if the bubble will collide with the collidable. false otherwise.
	 */
	public boolean collides(AbstractBubble bubble, Vector2 movement);

	/**
	 * Check if this collidable is sticky or reflects bubbles.
	 * @return true if sticky, false otherwise.
	 */
	public boolean isSticky();

	/**
	 * Check if this collidable is part of the world or just something attached to a part of the world.
	 * @return True if collidable is a part of the world, false otherwise.
	 */
	public boolean isPartOfWorld();

	/**
	 * Changes the bubbles velocity to reflect the change in movement with this collidable.
	 * @param bubble Bubble that collides with this collidable.
	 */
	public void collisionResponse(AbstractBubble bubble);
}
